package org.nlp2rdf.navigator.client.common;

import java.util.ArrayList;
import java.util.List;

@SuppressWarnings("serial")
public class StoredConceptDTO extends LearnedConceptDTO {

	private String uri;
	private int hitcounter = 0;
	private List<RatingDTO> ratings = new ArrayList<RatingDTO>();

	/**
	 * Use is discouraged and only for beans and serializers
	 * use other constructor
	 */
	@Deprecated
	@SuppressWarnings("deprecation")
	public StoredConceptDTO() {
		super();
	}

	@SuppressWarnings("deprecation")
	public StoredConceptDTO(LearnedConceptDTO learnedConceptDTO, String uri) {
		super();
		setAccuracy(learnedConceptDTO.getAccuracy());
		setBase(learnedConceptDTO.base);
		setComment(learnedConceptDTO.comment);
		setConceptComments(learnedConceptDTO.conceptComments);
		setKbSyntaxString(learnedConceptDTO.kbSyntaxString);
		setLabel(learnedConceptDTO.label);
		setManchesterSyntaxString(learnedConceptDTO.manchesterSyntaxString);
		setMsNeeded(learnedConceptDTO.msNeeded);
		setNamedConceptsAndProperties(learnedConceptDTO.namedConceptsAndProperties);
		setNamespaceToPrefix(learnedConceptDTO.namespaceToPrefix);
		setPrefixToNamespace(learnedConceptDTO.prefixToNamespace);
		setExamples(learnedConceptDTO.getExamples());

		this.uri = uri;
	}

	public void incrementHitcounter() {
		hitcounter++;
	}

	@Override
	public String toString() {
		StringBuffer ret = new StringBuffer();
		ret.append(super.toString());
		ret.append("hitcounter: " + getHitcounter() + "\n");
		ret.append("ratings: " + getRatings() + "\n");
		return ret.toString();
	}

	/** GETTERS AND SETTER BELOW **/

	public int getHitcounter() {
		return hitcounter;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}

	public void setHitcounter(int hitcounter) {
		this.hitcounter = hitcounter;
	}

	public List<RatingDTO> getRatings() {
		return ratings;
	}

	public void setRatings(List<RatingDTO> ratings) {
		this.ratings = ratings;
	}

}
